#ifndef BSTREE_H
#define BSTREE_H
#include <functional>
#include "BTree.h"

typedef unsigned long long u64;

template<typename T>
class BSTree : public BTree<T> {
    protected:
        class NodeS : public BTree<T>::Node {
            public:
                NodeS (T e, u64 k = 0, NodeS *l = NULL, NodeS *r = NULL)
                         : BTree<T>::Node(e,l,r), _key(k)
                    {  }
                ~NodeS () {}
                    
                int insert(const T&);
                u64 key() { return _key; }
	    protected:
                using BTree<T>::left;
                using BTree<T>::right;
        	u64 _key;
	};
    public :
	BSTree ( bool u = false )
            : BTree<T>(), multiset(u)
            {}
        virtual ~BSTree() {}

    protected :
	/* Indique si les clefs peuvent être uniques ou non dans l'ABR */
        /* A multiset is a set in which a given element can appear more than once */
        /* Namely, here, a key could be used more than once */
	const bool multiset;
        using BTree<T>::root;
};


#endif /* BSTREE_H */
